﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--suppress ALL-->
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>无标题文档</title>
	<link th:href="@{/css/style.css}" rel="stylesheet" type="text/css" />
	<script language="JavaScript" th:src="@{/js/jquery.js}"></script>
</head>

<body style="background:#fff3e1;">
<div class="lefttop">
	<span></span><a href="/users/index" target="rightFrame">首页</a>
</div>
<dl class="leftmenu"></dl>
</body>
</html>
<script>
	$(function () {

		/*// 三级菜单点击
		$('.sub-menus li').click(function(e) {
			$(".sub-menus li.active").removeClass("active")
			$(this).addClass("active");
		});*/


		$.ajax({
			url:"/users/getModule",
			type:"POST",
			dataType:"JSON",
			success:function (result) {
				if (result != null) {
					let lis = "";
					let parse = JSON.parse(result);
					for (let i in parse) {
						lis += "<dd><div class=\"title\">"+i+"</div><ul class=\"menuson\">";
						for (let j in parse[i]) {
							lis += "<li><cite></cite><a href="+parse[i][j].module_murl+" target=\"rightFrame\">"+
									parse[i][j].module_rname+"</a><i></i></li>";
						}
						lis += "</ul></dd>";
					}
					$(".leftmenu").html(lis);
					//导航切换
					$(".menuson .header").click(function(){
						var $parent = $(this).parent();
						$(".menuson>li.active").not($parent).removeClass("active open").find('.sub-menus').hide();

						$parent.addClass("active");
						if(!!$(this).next('.sub-menus').size()){
							if($parent.hasClass("open")){
								$parent.removeClass("open").find('.sub-menus').hide();
							}else{
								$parent.addClass("open").find('.sub-menus').show();
							}
						}
					});
					$('.title').click(function(){
						var $ul = $(this).next('ul');
						$('dd').find('.menuson').slideUp();
						if($ul.is(':visible')){
							$(this).next('.menuson').slideUp();
						}else{
							$(this).next('.menuson').slideDown();
						}
					});
				}
			}
		});
	})
</script>